package be.rugbyclubleuven.rachel.domain;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.Table;

import org.hibernate.annotations.Where;

@Entity
@Table(name = "FAML")
public class Lid implements Serializable {

	private Long id;
	private String naam;
	private String voornaam;

	private List<String> gsm;

	@Id
	@Column(name = "Lidid")
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name = "NAAM")
	public String getNaam() {
		return naam;
	}

	public void setNaam(String naam) {
		this.naam = naam;
	}

	@Column(name = "VNAAM")
	public String getVoornaam() {
		return voornaam;
	}

	public void setVoornaam(String voornaam) {
		this.voornaam = voornaam;
	}

	@ElementCollection(targetClass = java.lang.String.class)
	@JoinTable(name = "FLCO", joinColumns = @JoinColumn(name = "LIDID"))
	@Column(name = "NUMME", nullable = false)
	@Where(clause = "COMTY='G'")
	public List<String> getGsm() {
		return gsm;
	}

	public void setGsm(List<String> gsm) {
		this.gsm = gsm;
	}

}